package cd.safe.school.ui;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class MyDialog extends ProgressDialog {
	private Handler handler;

	public MyDialog(Context context, Handler handler) {
		this(context);
		this.handler = handler;

	}

	public MyDialog(Context context) {
		super(context);

	}

	public MyDialog(Context context, int theme) {
		super(context, theme);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

	}

	@Override
	public void cancel() {
		Message msg = new Message();
		msg.what = -1;
		handler.sendMessage(msg);
		super.cancel();
	}

	@Override
	public void dismiss() {
		Message msg = new Message();
		msg.what = -1;
		handler.sendMessage(msg);
		super.dismiss();
	}

	@Override
	public void setIndeterminate(boolean indeterminate) {
		super.setIndeterminate(indeterminate);
	}

	@Override
	public void setMessage(CharSequence message) {
		super.setMessage(message);
	}

	@Override
	public void setTitle(CharSequence title) {
		super.setTitle(title);
	}

	@Override
	public void show() {
		super.show();
	}

}
